project(dotdlayer)

cmake_minimum_required(VERSION 2.6)

Set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

find_package(SDL2 REQUIRED)
find_package(SDL2_net REQUIRED)
Find_Package(SDL2_mixer REQUIRED)
find_package(CryptoPP REQUIRED)

include_directories(
	${SDL2_INCLUDE_DIR}
	${SDL2_NET_INCLUDE_DIRS}
	${SDL2_MIXER_INCLUDE_DIRS}
	${CRYPTOPP_INCLUDE_DIRS}
)

add_library(common STATIC
	StringEncoding.cpp
	FileSystem.cpp
	Config.cpp
	EncryptedStream.cpp
)

add_executable(dotdlayer main.cpp)

target_link_libraries(dotdlayer
	common
	${SDL2_LIBRARY}
	${SDL2MAIN_LIBRARY}
	${SDL2_NET_LIBRARIES}
	${SDL2_MIXER_LIBRARIES}
	${CRYPTOPP_LIBRARIES}
)

add_executable(dotserver server.cpp)

target_link_libraries(dotserver
	common
	${SDL2_LIBRARY}
	${SDL2MAIN_LIBRARY}
	${SDL2_NET_LIBRARIES}
	${CRYPTOPP_LIBRARIES}
)
